package datatype

/**
 * @author: kevin  
 * @date: 20:21 2021/4/29
 */
object TypeDemo02 {
  def main(args: Array[String]): Unit = {
    //println(sayHello)

    var num = 1.2
    var num2 = 1.7f
    num2 = num.toFloat
    println(num2)
  }

  //当我们Nothing做返回值，就是明确说明该方法没有正确返回值
  def sayHello: Nothing = {
      throw new Exception("抛出异常")
  }

}
